package net.lzzy.practices.entities;


import com.fasterxml.jackson.annotation.JsonBackReference;
import lombok.Getter;
import lombok.Setter;

import javax.persistence.Entity;
import javax.persistence.ManyToMany;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import java.util.ArrayList;
import java.util.List;

/**
 *@author lzzy_gxy on 2022/5/8.
 *Description:
 */
@Entity //实体类
//@Table(name = "options")
@Getter
@Setter

public class Option extends BaseEntity{
    private String content;
    private String label;
    private boolean answer;

    @ManyToOne
    private Question question;


    @ManyToMany(mappedBy = "options")
    private List<Result> results=new ArrayList<>();
    public Option(){}

    @JsonBackReference
    public Question getQuestion() {
        return question;
    }

}
